About

The origin of the data for the model

numID<- 9022 # highest id value (max = 9022)
### Define the data that will populate the model
ds<- dsL %>%  # chose conditions to apply in creating dataset for modeling
  dplyr::filter(id < numID) %.% # 1:9022
  dplyr::filter(year %in% c(2000:2011)) %.% # 1997:2011
  dplyr::filter(sample %in% c(1)) %.% # 0-Oversample; 1-Cross-Sectional
  dplyr::filter(race %in% c(4)) %.% # 1-Black; 2-Hispanis; 3-Mixed; 4-White
  dplyr::filter(byear %in% c(1980:1984)) %.% # birth year 1980:1984
  dplyr::filter(ave(!is.na(attend), id, FUN = all)) %.% # only complete trajectories
  dplyr::mutate( # compute new variables
    age= year-byear, # definition of age to be used in the model    
    timec=year-2000, # metric of time is rounds of NSLY97 in years, centered at 2000
    timec2= timec^2, 
    timec3= timec^3,
    #         timec= age-16, # metric of time is bilogical age in years, centered at 16
    #         timec2= timec^2,
    #         timec3= timec^3,# 
    cohort=byear-1980) %.% # age difference, years younger (unit - 1 cohort away)
  dplyr::select( # assemble the dataset for modeling
    id, sample, race, byear,cohort, # Time Invariant variables
    year,
    age, timec,timec2,timec3, attend)  # Time Variant variables

Model specification

General case of LCM and model sequence are defined

############################

m0F – Fix Coef

plot of chunk m0F

m1F

plot of chunk m1F

m2F

plot of chunk m2F

m3F

plot of chunk m3F

m4F

plot of chunk m4F

m5F

plot of chunk m5F

m6F

plot of chunk m6F

m7F

plot of chunk m7F

mFa – Experiment F

plot of chunk mFa

mFb

plot of chunk mFb

mFc

plot of chunk mFc

mFf

plot of chunk mFf

mFd

plot of chunk mFd

mFe

plot of chunk mFe

m1R1 – 1 Ran Coef

plot of chunk m1R1

m2R1

plot of chunk m2R1

m3R1

plot of chunk m3R1

m4R1

plot of chunk m4R1

m5R1

plot of chunk m5R1

m6R1

plot of chunk m6R1

m7R1

plot of chunk m7R1

mR1a – Experiment R1

plot of chunk mR1a

mR1b

plot of chunk mR1b

mR1c

plot of chunk mR1c

mR1f

plot of chunk mR1f

mR1d

plot of chunk mR1d

mR1e

plot of chunk mR1e

m1R2 – 2 Ran Coef

plot of chunk m1R2

m2R2

plot of chunk m2R2

m3R2

plot of chunk m3R2

m4R2

plot of chunk m4R2

m5R2

plot of chunk m5R2

m6R2

plot of chunk m6R2

m7R2

plot of chunk m7R2

mR2b - Experiment

plot of chunk mR2b

mR2c

plot of chunk mR2c

mR2f

plot of chunk mR2f

mR2d

plot of chunk mR2d

mR2e

plot of chunk mR2e

m2R3 – 3 Ran Coef

plot of chunk m2R3

m3R3

plot of chunk m3R3

m4R3

plot of chunk m4R3

m5R3

plot of chunk m5R3

m6R3

plot of chunk m6R3

m7R3

plot of chunk m7R3

mR3f - Experiment

plot of chunk mR3f

mR3d

plot of chunk mR3d

mR3e

plot of chunk mR3e

m3R4 – 4 Ran Coef

plot of chunk m3R4

m4R4

plot of chunk m4R4

m5R4

plot of chunk m5R4

m6R4

plot of chunk m6R4

m7R4

plot of chunk m7R4